package com.withyou.baidusave;

import java.io.BufferedReader;
import java.io.FileInputStream;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
/**
 * 按照读取文件
 * @author guicheng.huang
 * @date 2019年9月17日
 */
public class FileUtil {

	public static List<String> readFileLine(String name){
		List<String> arrayList = new ArrayList<String>();
		try {
			InputStreamReader fReader = new InputStreamReader(new FileInputStream(name),"GBK");
			BufferedReader bf = new BufferedReader(fReader);
			String str;
			// 按行读取字符串
			while ((str = bf.readLine()) != null) {
				arrayList.add(str);
			}
			bf.close();
			fReader.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
		return arrayList;
	}
	
}
